// 管理员列表相关接口
import request from '@/utils/request'
// 列表
export function adminList(params) {
  return request({
    url: '/api/users',
    method: 'get',
    params,
  })
}
// 新增
export function addAadmin(data) {
  return request({
    url: '/api/register',
    method: 'post',
    data,
  })
}
// 修改
export function editAdmin(data,username) {
  return request({
    url: `/api/addusers/${username}`,
    method: 'post',
    data,
  })
}
// 删除
export function deleteAdmin(username) {
  return request({
    url: `/api/delusers/${username}`,
    method: 'post',
  })
}
// 详情
export function adminDetail(params) {
  return request({
    url: '/admin/info',
    method: 'get',
    params,
  })
}
// 获取设置详情
export function setDetail(params) {
  return request({
    url: '/api/json_data',
    method: 'get',
    params,
  })
}

// 修改设置详情
export function editSetDetail(data) {
  return request({
    url: '/api/json_data',
    method: 'post',
    data,
  })
}

// 全部角色
export function allRole(params) {
  return request({
    url: '/role/list',
    method: 'get',
    params,
  })
}
// 角色列表
export function roleList(params) {
  return request({
    url: '/role/list',
    method: 'get',
    params,
  })
}
// 新增
export function addRole(data) {
  return request({
    url: '/role/add',
    method: 'post',
    data,
  })
}
// 修改
export function editRole(data) {
  return request({
    url: '/role/edit',
    method: 'post',
    data,
  })
}
// 删除
export function deleteRole(data) {
  return request({
    url: '/role/delete',
    method: 'post',
    data,
  })
}
// 详情
export function roleDetail(params) {
  return request({
    url: '/web/role/detail',
    method: 'get',
    params,
  })
}
// 权限列表
export function permissionList(params) {
  return request({
    url: '/auth/list',
    method: 'get',
    params,
  })
}
// 新增
export function addPermission(data) {
  return request({
    url: '/auth/add',
    method: 'post',
    data,
  })
}
// 修改
export function editPermission(data) {
  return request({
    url: '/auth/edit',
    method: 'post',
    data,
  })
}
// 删除
export function deletePermission(data) {
  return request({
    url: '/auth/delete',
    method: 'post',
    data,
  })
}
// 详情
export function permissionDetail(params) {
  return request({
    url: '/web/permission/detail',
    method: 'get',
    params,
  })
}
// 菜单列表
export function allMenu(params) {
  return request({
    url: '/menu/tree',
    method: 'get',
    params,
  })
}
// 新增
export function addMenu(data) {
  return request({
    url: '/menu/add',
    method: 'post',
    data,
  })
}
// 修改
export function editMenu(data) {
  return request({
    url: '/menu/edit',
    method: 'post',
    data,
  })
}
// 删除
export function deleteMenu(data) {
  return request({
    url: '/menu/delete',
    method: 'post',
    data,
  })
}
